package com.hbnu;

public class Weather {
    private String city;
    private double temperature;
    private int humidity;
    private String date;

    // 必须要有这个构造函数
    public Weather(String city, double temperature, int humidity, String date) {
        this.city = city;
        this.temperature = temperature;
        this.humidity = humidity;
        this.date = date;
    }

    // 默认构造函数
    public Weather() {
    }

    // Getter 和 Setter 方法
    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public double getTemperature() {
        return temperature;
    }

    public void setTemperature(double temperature) {
        this.temperature = temperature;
    }

    public int getHumidity() {
        return humidity;
    }

    public void setHumidity(int humidity) {
        this.humidity = humidity;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    @Override
    public String toString() {
        return "Weather{" +
                "city='" + city + '\'' +
                ", temperature=" + temperature +
                ", humidity=" + humidity +
                ", date='" + date + '\'' +
                '}';
    }
}